package com.xjzd.std.concurrency;

public class ThreadDaemon {

    public static void main(String[] args) {
        // JVM会在程序中没有非守护线程时结束
        Thread thread = new Thread(() -> {
            for (int i = 0; i < 1; i++) {
                System.out.println(i);
            }
        });
        thread.setDaemon(true);
        thread.start();

        System.out.println("main");
    }
}
